---@diagnostic disable: lowercase-global, undefined-global, trailing-space

---@type data_containerUI
local params = {}

-- params.new_ui = {
--     widget =
--     {
--         animbank = 'ui_chest_3x3',
--         animbuild = 'ui_chest_3x3', 
--         slotpos = {},
--         slotbg = {},
--         pos = Vector3(-340, -120, 0),
--         side_align_tip = 160,
--         buttoninfo = {
--             text = 'hit',
--             position = Vector3(0, 80*-2+10, 0),
--         },
--         dragtype_drag = 'new_ui',
--         unique = 'new_ui',
--     },
--     type = 'new_ui',
--     itemtestfn = function(container, item, slot)
--         -- if slot == nil then -- 这样设置就能让shift左键失效,还能保证giveitem能用,我也不知道原因,群佬没告诉我
--         --     return false 
--         -- end
--         -- if item:HasTag('gem') then return true end
--         -- return false
--     end
-- }

-- for y = 2, 0, -1 do
--     for x = 0, 1 do
--         table.insert(params.new_ui.widget.slotpos, Vector3(80 * (x - 2) + 130, 80 * (y - 2) + 75, 0))
--         -- table.insert(params.new_ui.widget.slotbg, { atlas="images/slotbg/.xml",image = ".tex" })
--     end
-- end

params.webbert_pack = {
    widget = {
        animbank = 'ui_chest_3x3',
        animbuild = 'ui_chest_3x3',
        slotbg = {},
        slotpos = {},
        pos = Vector3(-340, -120, 0),
        dragtype_drag = 'webbert_pack',
        unique = 'webbert_pack',
    },
    type = 'webbert_pack',
    usespecificslotsforitems = true,
    itemtestfn = function (container, item, slot)
        return true
    end
}

for i = 1, TUNING.MOD_WEBBER_THE_TRAINER.ITEMS.webbert_pack.ui.page do
    for x = 1, TUNING.MOD_WEBBER_THE_TRAINER.ITEMS.webbert_pack.ui.col_singlepage do
        for y = 1, TUNING.MOD_WEBBER_THE_TRAINER.ITEMS.webbert_pack.ui.row_singlepage do
            table.insert(params.webbert_pack.widget.slotpos, Vector3(80*x - 240, 80*y - 220 - 80, 0))
        end
    end
end

------------------------
params.webbert_skitter = {
    widget =
    {
        animbank = 'ui_chest_3x3',
        animbuild = 'ui_chest_3x3', 
        slotpos = {},
        slotbg = {},
        pos = Vector3(-120, 100, 0),
    },
    type = 'webbert_skitter',
}

for y = 2, 0, -1 do
    for x = 0, 2 do
        table.insert(params.webbert_skitter.widget.slotpos, Vector3(80 * (x - 2) + 80, 80 * (y - 2) + 70, 0))
        -- table.insert(params.new_ui.widget.slotbg, { atlas="images/slotbg/.xml",image = ".tex" })
    end
end
------------------------
params.webbert_sack = {
    widget = {
        animbank = 'ui_krampusbag_2x8',
        animbuild = 'ui_krampusbag_2x8',
        slotbg = {},
        slotpos = {},
        pos = Vector3(340, 0, 0),
        dragtype_drag = 'webbert_sack',
        unique = 'webbert_sack',
    },
    type = 'webbert_sack',
    usespecificslotsforitems = true,
    itemtestfn = function (container, item, slot)
        return true
    end
}

for i = 1, TUNING.MOD_WEBBER_THE_TRAINER.ITEMS.webbert_sack.ui.page do
    for x = 1, TUNING.MOD_WEBBER_THE_TRAINER.ITEMS.webbert_sack.ui.col_singlepage do
        for y = 1, TUNING.MOD_WEBBER_THE_TRAINER.ITEMS.webbert_sack.ui.row_singlepage do
            table.insert(params.webbert_sack.widget.slotpos, Vector3(80*x - 450, 80*y - 220 - 200, 0))
        end
    end
end
------------------------
params.webbert_seedbox = {
    widget =
    {
        animbank = 'ui_chester_shadow_3x4',
        animbuild = 'ui_chester_shadow_3x4', 
        slotpos = {},
        slotbg = {},
        pos = Vector3(-120, 100, 0),
        dragtype_drag = 'webbert_seedbox',
    },
    type = 'webbert_seedbox',
    itemtestfn = function (container, item, slot)
        -- if item and item:HasTag('deployedplant') and item:HasTag('deployedfarmplant') and string.find(item.prefab or '','seeds') then
        --     return true
        -- end
        if item and item.prefab and TUNING.MOD_WEBBER_THE_TRAINER.map_seeds[item.prefab] then
            return true
        end
        return false
    end
}

table.insert(params.webbert_seedbox.widget.slotpos, Vector3(0, 300, 0))
table.insert(params.webbert_seedbox.widget.slotbg, { atlas="images/frames/merged_img_1750061493.xml",image = "1.tex" })
-- for y = 2, 0, -1 do
--     for x = 0, 2 do
--         table.insert(params.webbert_skitter.widget.slotpos, Vector3(80 * (x - 2) + 80, 80 * (y - 2) + 70, 0))
--         -- table.insert(params.new_ui.widget.slotbg, { atlas="images/slotbg/.xml",image = ".tex" })
--     end
-- end

return params